    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// 根据用户ID获取菜单树
export const getMenuTree = () => {
    return service({
        url: '/user/index/getMenuTree',
        method: 'post'
    })
};


// 管理员登录
export const adminLogin = (data:any) => {
    return service({
        url: '/user/index/adminLogin',
        method: 'post',
        data
    })
};

// 分页获取商户列表
export const getUserList = (data:any) => {
    return service({
        url: '/user/index/getUserList',
        method: 'post',
        data
    })
};

// 分页获取品牌列表
export const getBrandList = (data:any) => {
    return service({
        url: '/shop/index/getBrandList',
        method: 'post',
        data
    })
};

// 添加品牌
export const addBrand = (data:any) => {
    return service({
        url: '/shop/index/addBrand',
        method: 'post',
        data
    })
};

// 修改品牌显示状态
export const changeBrandStatus = (data:any) => {
    return service({
        url: '/shop/index/changeBrandStatus',
        method: 'post',
        data
    })
};

// 删除品牌
export const deleteBrand = (brandId:any) => {
    return service({
        url: '/shop/index/deleteBrand/' + brandId,
        method: 'post',
    })
};

// 批量删除品牌
export const deleteBatchBrand = (data:any) => {
    return service({
        url: '/shop/index/deleteBatchBrand',
        method: 'post',
        data
    })
};

// 获取商品分类树
export const getTypeTree = () => {
    return service({
        url: '/shop/type/getTypeTree',
        method: 'post',
    })
};

// 添加商品分类
export const addType = (data:any) => {
    return service({
        url: '/shop/type/addType',
        method: 'post',
        data
    })
};

// 商品列表分页
export const getProdList = (data:any) => {
    return service({
        url: '/shop/prod/getProdList',
        method: 'post',
        data
    })
};


// 获取字典列表
export const getDictList = (typeId:any) => {
    return service({
        url: '/shop/dict/getDictList/' + typeId,
        method: 'post',
    })
};

// 获取商品分类多级选择框数据
export const getSelectTypeTree = () => {
    return service({
        url: '/shop/type/getSelectTypeTree',
        method: 'post',
    })
};

// 商品添加
export const addProd = (data:any) => {
    return service({
        url: '/shop/prod/addProd',
        method: 'post',
        data
    })
};

// 添加商品附件
export const addProdAtta = (data:any) => {
    return service({
        url: '/shop/prod/addProdAtta',
        method: 'post',
        data
    })
};

// 批量删除商品
export const deleteBatchProd = (data:any) => {
    return service({
        url: '/shop/prod/deleteBatchProd',
        method: 'post',
        data
    })
};

// 删除商品
export const deleteProd = (prodId:any) => {
    return service({
        url: '/shop/prod/deleteProd/' + prodId,
        method: 'post',
    })
};

// 分页获取订单列表
export const getOrderList = (data:any) => {
    return service({
        url: '/shop/order/getOrderList',
        method: 'post',
        data
    })
};

// 获取商品信息列表
export const getProdInfoList = () => {
    return service({
        url: '/shop/prod/getProdInfoList',
        method: 'post',
    })
};

// 新增订单
export const addOrder = (data:any) => {
    return service({
        url: '/shop/order/addOrder',
        method: 'post',
        data
    })
};

// 从ES索引中分页获取商品列表
export const getProdFromEs = (data:any) => {
    return service({
        url: '/shop/prod/getProdFromEs',
        method: 'post',
        data
    })
};

// 获取当前用户的信息
export const getUserInfo = () => {
    return service({
        url: '/user/index/getUserInfo',
        method: 'post',
    })
};

// 根据订单ID获取订单信息
export const getOrderInfoById = (orderId: any) => {
    return service({
        url: '/shop/order/getOrderInfoById/' + orderId,
        method: 'post',
    })
};


// 分页获取活动列表
export const getActiveList = (data:any) => {
    return service({
        url: '/win/index/getActiveList',
        method: 'post',
        data
    })
};


// 添加抽奖活动
export const addActive = (data:any) => {
    return service({
        url: '/win/index/addActive',
        method: 'post',
        data
    })
};

// 用户抽奖接口
export const joinActive = (activeId:any) => {
    return service({
        url: '/win/index/joinActive/' + activeId,
        method: 'post',
    })
};

// 用户签到送积分接口
export const signIn = () => {
    return service({
        url: '/user/index/signIn',
        method: 'post',
    })
};